//
//  ZYSImgHeaderModels.m
//  budejie
//
//  Created by oldSix_Zhu on 16/8/27.
//  Copyright © 2016年 oldSix_Zhu. All rights reserved.
//

#import "ZYSImgHeaderModels.h"
#import "OSZNetWorkTool.h"

@implementation ZYSImgHeaderModels
+(instancetype)ZYSImgHeaderModelsWithDic:(NSDictionary *)dic
{
    ZYSImgHeaderModels *model = [[ZYSImgHeaderModels alloc]init];
    
    [model setValuesForKeysWithDictionary:dic];
    
    return model;
}

-(void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    
}

+(void)loadImgHeaderWithUrlStr:(NSString *)urlStr  successBlock:(void(^)(ZYSImgHeaderModels *model))successBlock failBlock:(void(^)(NSError *error))failBlock
{
    [[OSZNetWorkTool sharedOSZNetWorkTool]GET:urlStr parameters:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        
        NSDictionary *dic = responseObject;
        
        NSDictionary *dic1 = dic[@"info"];
        
        ZYSImgHeaderModels *model = [self ZYSImgHeaderModelsWithDic:dic1];
        
        if (successBlock)
        {
            successBlock(model);
        }
        
        
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        if (failBlock)
        {
            failBlock(error);
        }
    }];
}

@end
